package com.truyen.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.truyen.persistence.dao.SearchLoaiTruyenKiemHiepDao;
import com.truyen.persistence.entity.LoaiTruyenChu;
import com.truyen.persistence.entity.SearchLoaiTruyenKiemHiep;
import com.truyen.persistence.entity.TruyenKiemHiep;
import com.truyen.service.SearchLoaiTruyenKiemHiepService;
import com.truyen.utils.PagingInfo;


@Service
public class SearchLoaiTruyenKiemHiepServiceImpl implements SearchLoaiTruyenKiemHiepService {
	
	@Autowired
	private SearchLoaiTruyenKiemHiepDao searchLoaiTruyenKiemHiepDao;

	@Override
	public void save(SearchLoaiTruyenKiemHiep entity) {
		searchLoaiTruyenKiemHiepDao.save(entity);
	}

	@Override
	public SearchLoaiTruyenKiemHiep findById(Long id) {
		return searchLoaiTruyenKiemHiepDao.findById(id);
	}

	@Override
	public List<SearchLoaiTruyenKiemHiep> getAll() {
		return searchLoaiTruyenKiemHiepDao.findAll();
	}

	@Override
	public SearchLoaiTruyenKiemHiep findByProperty(String column, Object value) {
		List<SearchLoaiTruyenKiemHiep> lst = searchLoaiTruyenKiemHiepDao.findByProperty(column, value);
		return (lst.size()>0)?lst.get(0):null;
	}

	@Override
	public List<SearchLoaiTruyenKiemHiep> getAllLst(String kwSearch, String sort, String sortBy,
			PagingInfo pInfo) {
		return searchLoaiTruyenKiemHiepDao.getAllLst(kwSearch,sort,sortBy,pInfo);
	}

	@Override
	public SearchLoaiTruyenKiemHiep findByLoaiTruyenKiemHiepVTruyenKiemHiep(
			LoaiTruyenChu loaiTruyenChu, TruyenKiemHiep truyen) {
		return searchLoaiTruyenKiemHiepDao.findByLoaiTruyenKiemHiepVTruyenKiemHiep(loaiTruyenChu,truyen);
	}

	@Override
	public List<SearchLoaiTruyenKiemHiep> getLstByLoaiTruyenKiemHiepWithPaging(
			LoaiTruyenChu loaiTruyenChu, String orderBy, PagingInfo pInfo) {
		return searchLoaiTruyenKiemHiepDao.getLstByLoaiTruyenKiemHiepWithPaging(loaiTruyenChu,orderBy,pInfo);
	}


}
